**** Figure 3a: Number of branches and religiosity ***
use "$Data_generated/Commune.dta", clear
egen sum_sect1b=sum(nb_sectperm) if Pasc<0.3365316 & !missing(Pasc), by(year)
egen sum_sect2b=sum(nb_sectperm) if Pasc>=0.3365316 & !missing(Pasc), by(year)
egen sum_sect1=max(sum_sect1b), by(year)
egen sum_sect2=max(sum_sect2b), by(year)

gen max=80
duplicates drop year, force
tsset year
twoway (bar max year if inrange(year, 1926.5, 1927.5), color(gs12)) (line sum_sect1 sum_sect2 year if year>1915, xtitle("Year") ytitle("Nb of Branches") xlabel(1921(1)1936) lcolor(gs1 gs9) legend(off) text(50 1927 "Condemnation", orientation(vertical))) (scatter sum_sect1 year if year>1920 & year<1936, mcolor(gs6) msymbol(T)) (scatter sum_sect2 year if year>1920 & year<1936, mcolor(gs6) msymbol(S))
graph export "$Figures/Figure4a.pdf", name(Graph) replace
graph export "$Figures/Figure4a.png", name(Graph) replace